package com.ibm.risk.irmp.data.table.rest;

import com.ibm.risk.irmp.data.table.service.IDataTableQueryService;
import com.ibm.risk.irmp.data.table.vo.TableDataQueryParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/v2/data-query")
public class DataTableQueryController {
    @Autowired
    IDataTableQueryService dataTableQueryService;

    @PostMapping("/tables/{table}")
    Map<String, Object> getTableData(@PathVariable String table, @RequestBody TableDataQueryParam dataQueryParam) {
        return dataTableQueryService.getTableData(table, dataQueryParam);
    }

}
